﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Trakt.Model;

namespace Trakt
{
    public class TraktTvException : Exception
    {
        public ErrorResponse ErrorResponse { get; set; }

        public TraktTvException(ErrorResponse error)
            : this(error, null) { }

        public TraktTvException(ErrorResponse error, Exception innerException)
            : base(string.Format("Trakt.Tv returned an {0} error. \"{1}\"", error.Error, error.Description), innerException)
        {
            ErrorResponse = error;
        }

        public TraktTvException(string message)
            : base(message) { }

        public TraktTvException(string message, ErrorResponse error)
            : base(message)
        {
            ErrorResponse = error;
        }

        public TraktTvException(string message, ErrorResponse error, Exception innerException)
            : base(message, innerException)
        {
            ErrorResponse = error;
        }

        public TraktTvException(string message, Exception innerException)
            : base(message, innerException) { }
    }
}
